package com.longshen.dubbo.api.interceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 配置拦截器
 * 
 * @class: InterceptorConfig
 * @title: 配置拦截器
 * @desc:
 * @author: Mario
 * @date: 2018年3月29日 下午12:57:45
 * @since: 1.0.0
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

	@Autowired
	private LoginRequiredInterceptor loginRequiredInterceptor;
	
	@Autowired
	private TradeRequiredInterceptor tradeRequiredInterceptor;
	
	@Autowired
	private TradeLogInterceptor tradeLogInterceptor;

	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(tradeLogInterceptor);
		registry.addInterceptor(loginRequiredInterceptor);
		registry.addInterceptor(tradeRequiredInterceptor);
	}
   

}
